The present invention is related generally to the field of computer graphics, and more particularly, a system and method for resampling graphics data of a source image to produce a destination image.
As display devices of various sizes and increased resolution have been developed and the demand for them have increased, the ability for a graphics processing system to resize and resample source images and create destination images to take advantage of the various sized and higher resolution displays is a desirable operation. In an electronic display system, color at each pixel is represented by a set of color components, and each color component is represented by a sample value. Color components such as red, green, blue (RGB) or other representations such as YCbCr are well known in the art. Whichever representation is chosen, each color component can be interpreted as a two dimensional array of samples, so three such arrays can represent images on display systems. Conceptually, resampling can be viewed as a spatial process, working on discrete input samples, represented by each color component in the source image arranged in a two-dimensional bitmap. The output samples of the destination image are spatially located at fractional sample positions within the input sample grid. Various interpolation and modeling methods are used to construct transition models between samples of the source image from which additional graphics data is produced during the resampling operation.
The additional graphics data is then used to produce larger or higher resolution destination graphics images. However, the resulting destination image must retain an acceptable image quality with respect to the source image. That is, the destination image should appear to retain at least a similar visual qualities of the source image, such as having nearly the same color balance, contrast, and brightness as the original source image. Otherwise, rather than accurately reproducing a larger or higher resolution graphics image of the source image, the resampling operation will compromise image quality by introducing image distortion. To this end, various resampling algorithms have been developed in order to create high quality destination graphics images.
With many conventional resampling algorithms, a transition model between input samples along each axis is constructed to provide output sample values. Generally good results can be obtained with separable processing along each axis for graphics images because image feature cross-sections have the same characteristics when viewed at any angle within the image plane, only at different effective sample rates. The transition models between the input samples are constructed such that the output samples interpolated from the transition model create a destination image that closely resembles the original or source image. The transition models are typically continuous so that an output sample can be generated at any position between the input samples.
Although an axis separable cubic model between two input samples can provide a model with very desirable reconstruction characteristics, generating the models are often cumbersome and result in resampling circuits that include large and complicated circuitry. For example, a linear filtering system, such as a finite impulse response (FIR) filter, may be used to calculate gradients for a cubic model that produces acceptable resampling results. However, the resulting resampling circuit includes multiple stages and taps from which the coefficients of the cubic model are calculated and used to produce interpolated output sample values. Where miniaturization and simplicity of implementation are desired, including such a resampling circuit in the graphics processing system may not be a desirable solution. Moreover, many resampling algorithms are developed with preserving spectral content of the source image in mind, as with the use of linear filters. However, this method may result in destination images that appear blurrier than the source image when viewed at the same size. As mentioned previously, it is not desirable for a resampling operation to produce a destination image having apparent lower quality than the source image.
Therefore, there is a need for an alternate method and system for resampling graphics data of a source image.
The present invention relates to a resampling system and method for determining an output sample value for a destination pixel located between first and second adjacent source pixels having respective sample values. The resampling system solves coefficients for a cubic polynomial transition model between the first and second adjacent pixels from the sample values of the first and second pixels and approximations of the first and second sample gradients at the first and second pixels, respectively. The approximations of the first and second sample gradients are based on a multiple of first and second sample slopes estimates, such as twice the value of the sample slope. Along one axis, an output sample can be obtained from 4 samples nearest to it, two before, and two after, fpxe2x88x921, fp, fp+1, and fp+2 The gradient cosited with fp is initially estimated as fpxe2x88x92(fpxe2x88x921) and the gradient cosited as fp+1 is estimated as (fp+2)xe2x88x92(fp+1).
Additionally, where the first and second slopes have opposite polarities, the first and second sample gradients may be approximated as being equal to the first and second sample slopes, respectively. An additional third slope may also be calculated from the sample values of the first and second pixels and compared with the first and second slopes for the approximation of the first and second sample gradients. The approximation of the first and second sample gradients are then a multiple, such as two times, of the lesser of the third slope and the respective slope value. Where the first and third slopes have opposite polarities, the first sample gradient may be approximated as being equal to the first slope, and where the second and third slopes have opposite polarities the second sample gradient may be approximated as being equal to the second slope.